package com.test;

import java.io.IOException;
import java.io.Reader;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import com.Dao.LiuYanDao;

public class DeleteLiuYanById {

	public static void main(String[] args) {
		String resource="mybatis-config.xml";
		Reader reader=null;
		try {
			reader=Resources.getResourceAsReader(resource);
			SqlSessionFactory sessionFactory=new SqlSessionFactoryBuilder().build(reader);
			SqlSession session=sessionFactory.openSession();
			LiuYanDao lydao=session.getMapper(LiuYanDao.class);
			lydao.deleteLiuYanById(4);
			session.commit();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		

	}

}
